package com.hengby.hengcrud.modular.job.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.hengby.hengcrud.modular.job.mapper.JobLogMapper;
import com.hengby.hengcrud.modular.job.model.JobLog;
import com.hengby.hengcrud.modular.job.service.JobLogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;

/**
 * @author zhouheng
 */
@Service("JobLogService")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class JobLogServiceImpl extends ServiceImpl<JobLogMapper,JobLog> implements JobLogService {

	@Override
	public List<Map<String, Object>> findAllJobLogs() {
		return this.baseMapper.selectMaps(new EntityWrapper<>());
	}

	@Override
	@Transactional
	public void saveJobLog(JobLog log) {
		this.baseMapper.insert(log);
	}

	@Override
	@Transactional
	public void deleteBatch(String jobLogIds) {
//		List<String> list = Arrays.asList(jobLogIds.split(","));
//		this.batchDelete(list, "logId", JobLog.class);
	}

}
